package com.asen.commons.core.jdbc.param;

import com.asen.commons.core.meta.entity.FieldObject;

/**
 * SQL语句关联字段对象
 *
 * @author Gary
 * @version 1.0
 * @date 2021-08-21
 */
public class SqlColumn {

    /**
     * 属性全名
     */
    private String fullName;

    /**
     * 带别名字段
     */
    private String fullColumn;

    /**
     * 表别名
     */
    private String tableAlias;

    /**
     * 类型
     */
    private FieldObject fieldObject;

    public SqlColumn() {

    }

    public SqlColumn(String fullName, String fullColumn, String tableAlias, FieldObject fieldObject) {
        this.fullName = fullName;
        this.fullColumn = fullColumn;
        this.tableAlias = tableAlias;
        this.fieldObject = fieldObject;
    }

    public Object getValue(Object model) throws IllegalAccessException {
        return fieldObject.getValue(model);
    }

    public Class<?> getJavaType() {
        return fieldObject.getJavaType();
    }

    public String getFullName() {
        return fullName;
    }

    public void setFullName(String fullName) {
        this.fullName = fullName;
    }

    public String getFullColumn() {
        return fullColumn;
    }

    public void setFullColumn(String fullColumn) {
        this.fullColumn = fullColumn;
    }

    public String getTableAlias() {
        return tableAlias;
    }

    public void setTableAlias(String tableAlias) {
        this.tableAlias = tableAlias;
    }

    public FieldObject getFieldObject() {
        return fieldObject;
    }

    public void setFieldObject(FieldObject fieldObject) {
        this.fieldObject = fieldObject;
    }
}
